<?php
if ($this->entity->questionlist AND $this->entity->template) {
    
    
    $questions = new Led_Entity_Collection(0, 19, $this->app->getLangid(), 2, $this->entity->questionlist, 70);
            
    if ($questions->count()) {
        if ($this->entity->questionid != 0) {
            if ($this->entity->questionid == -1) {
               $this->entity->question = $questions->current();
            } else {
                
                print $this->entity->questionid;
                
                $this->entity->question = $questions[$this->entity->questionid];
            }
        }
    }
}

// $GLOBALS['led_headprocessor']->Add("script", NULL, "entities/21/popuppah.js");

if (isset($this->entity->question)) {
print "<form target=\"gallup\" onsubmit=\"popuppah('','gallup','scrollbars=1,resizable=no,screenX=0,screenY=0,width=400,height=400');return true;\" name=\"quickgallup_{$this->entity->id}\" class=\"quickgallup\" method=\"post\" action=\"$entityroot/21/vote.php?langid=$langid&amp;gallupid={$this->entity->id}&amp;questionlist={$this->entity->questionlist}&amp;questionid=" . $this->entity->question->id . "&amp;allowbrowse={$this->entity->allowbrowse}\">\n";
print $this->entity->question->question;
print "<ul class=\"qgallup\">\n";
foreach ($this->entity->question->answers as $key => $value) {
if (is_a($value, 'ent_answer')) {
print "<li>";
$this->entity->PrintLink($value);
print "</li>\n";
} else {
print "<li>";
print Led_Entity_Renderer::getInstance()->render($value);
print "</li>\n";
}
}
print "</ul>\n";
print "</form>\n";
}
